package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SiteInfo;
import com.ruoyi.system.service.SiteInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/siteInfo")
public class SiteInfoController {
    @Autowired
    private SiteInfoService siteInfoService;

    @Log(title = "站点信息查询", businessType = BusinessType.OTHER)
    @RequestMapping("/selectsite")
    @PreAuthorize("@ss.hasPermi('system:station:selectsite')")
    public SiteInfo selectByPrimaryKey(@RequestParam Long id) {
        return siteInfoService.selectByPrimaryKey(id);
    }
    @Log(title = "站点信息修改", businessType = BusinessType.UPDATE)
    @RequestMapping("/updatesite")
//    @PreAuthorize("@ss.hasPermi('system:station:updatesite')")
    public int updateSiteInfo(@RequestBody SiteInfo record) {
        return siteInfoService.updateSiteInfo(record);
    }
}
